package com.geovis.emergency.spd.entity.command.pojo.vo;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.geovis.emergency.spd.entity.pc.entity.PcDrillDisasterEvent;
import com.geovis.emergency.spd.entity.pc.pojo.vo.PcDrillDutyOrgVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;

/**
 * 指挥系统-演练事件消息列表vo对象
 */
@Getter
@Setter
@ToString(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "CommandDrillDisasterVo", description = "指挥系统-演练事件列表vo对象")
public class CommandDrillDisasterEventVo {

    @ApiModelProperty("主键")
    private String id;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "报送时间")
    private String submitTime;

    @ApiModelProperty("来源部门名称")
    private String sourceDept;

    public static CommandDrillDisasterEventVo fromPcDrillDisasterEvent(PcDrillDisasterEvent drillDisasterEvent)
    {
        CommandDrillDisasterEventVo eventVo=new CommandDrillDisasterEventVo();
        BeanUtils.copyProperties(drillDisasterEvent,eventVo);
        eventVo.setSubmitTime(LocalDateTimeUtil.format(drillDisasterEvent.getSubmitTime(),"MM-dd HH:mm:ss"));
        eventVo.setSourceDept(drillDisasterEvent.getSource());
        return eventVo;
    }

}
